package com.test.chinamobileai.controller;

import com.test.chinamobileai.dto.ChatDTO;
import com.test.chinamobileai.service.ChatService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
public class ChatController {
    @Resource
    private ChatService chatService;

    @PostMapping("move/search")
    public Flux<String> search(@RequestBody ChatDTO chatDTO) {
        return chatService.chatStream(chatDTO.getQuestion(), chatDTO.getSessionId());
    }

}
